<div id="content-flash">
    <?php if($this->session->flashdata('article') != null){ ?>
    <p id="content-notif">
        <?php
        echo $this->session->flashdata('article');
        ?>
    </p>
    <?php } ?>
</div>
<div id="content-title">
    <p id="ctitle-p">
        New Article
    </p>
</div>
<div class="hor-line"></div>
<div id="content">
    <form action="<?php echo base_url() ?>article/add" method="post" enctype="multipart/form-data">
        <div class="content-field">
            <p class="p-wrapper">
                <span class="field label">
                    <label>TITLE</label>
                    <input type="text" name="ftitle" id="ftitle" value="<?php echo $this->session->flashdata('ftitle');?>"/>
                </span>
            </p>
        </div>
        <div class="content-field">
            <p class="p-wrapper">
                <span  class="field label">
                    <label>CATEGORY</label>
                    <select name="fcategory">
                        <?php foreach($category->result() as $article){ ?>
                        <option value="<?php echo $article->category_id;?>"><?php echo $article->category_name;?></option>
                        <?php } ?>
                    </select>
                </span>
            </p>
        </div>
        <div class="content-field">
            <p class="p-wrapper">
                <span class="field label">
                    <label>PUBLISHED</label>
                    <select name="fpublished">
                        <option value="1" selected="selected">Yes</option>
                        <option value="0">No</option>
                    </select>
                </span>
            </p>
        </div>
        <div class="content-field">
            <p class="p-wrapper">
                <span  class="field label">
                    <label>CONTENT</label>
                </span>
            </p>
        </div>
        <div class="field-separator"></div>
        <div class="content-field">
            <script type="text/javascript">
                $(document).ready(function() {
                    $("#fcontent").cleditor({
                        width:870
                    });
                });
            </script>
            <textarea id="fcontent" style="width:100%" name="fcontent">
                <?php echo $this->session->flashdata('fcontent');?>
            </textarea>
        </div>
        <div class="content-field">
            <p class="p-wrapper">
                <span  class="field label">
                    <label>IMAGE UPLOAD</label>
                </span>
            </p>
        </div>
        <div class="content-field">
            <p class="p-wrapper">
                <span  class="field label">
                    <label>IMAGE TITLE</label>
                    <input type="text" name="fimage-title" />
                </span>
            </p>
        </div>
        <div class="content-field">
            <p class="p-wrapper">
                <span  class="field label">
                    <label>IMAGE FILE</label>
                    <input type="file" name="fimage-file" id="fmedia-file"/>
                </span>
            </p>
        </div>
        <div class="field-separator"></div>
        <div class="field-separator"></div>
        <div class="content-field">
            <input type="image" src="<?php echo base_url(); ?>img/style/submit_button.png"/>
        </div>
    </form>
</div>